home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / editor / blksedtr.lha / BED / Rexx / SASC / FetchRefs.bed < prev    next >
Text File  |  1996-05-06  |  2KB  |  69 lines

  1. /*
  2. ** $VER: FetchRefs.bed 1.0 (18.04.96)
  3. **
  4. ** FetchRefs - By Gerbert Nuijen
  5. **
  6. ** An ARexx script to invoke FetchRefs from BED. It will get the current word
  7. ** under the cursor and will send an request to FetchRefs to get all possible
  8. ** references. It will automatically open an window with possible refs on the
  9. ** BED screen.
  10. **
  11. */
  12.  
  13. /* Set some options of ARexx */
  14. OPTIONS RESULTS
  15. OPTIONS FAILAT 21
  16.  
  17. /* Get the current word under the cursor */
  18. GetWord
  19. function = RESULT
  20.  
  21. IF word="" THEN DO
  22.     BeepScreen
  23.     SetStatusBar "Cursor not on a word!"
  24.     RETURN
  25. END
  26.  
  27. /* Define a temporary filename to put the reference into */
  28. cutat = VERIFY(function, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_")
  29. filename = 'T:FR_' || LEFT(function, MAX(0, cutat - 1))
  30.  
  31. /* It doesn't matter whether we want a taglist, varargs or whatever function */
  32. IF RIGHT(function, 7) = "TagList" THEN
  33.      function = LEFT(function, LENGTH(function) - 7)
  34. ELSE IF RIGHT(function, 4) = "Tags" THEN
  35.      function = LEFT(function, LENGTH(function) - 4)
  36. ELSE IF RIGHT(function, 1) = "A" THEN
  37.      function = LEFT(function, LENGTH(function) - 1)
  38.  
  39. /* Get the reference */
  40. address 'FETCHREFS' FR_GET function || '(%|Tags|TagList|A)' filename FILEREF
  41.  
  42. /* Load the file */
  43. IF rc ~= 0 THEN DO
  44.     /*
  45.         Maybe search with FindSymbol.bed for more references ??
  46.     */
  47.  
  48.     BeepScreen
  49.     SetStatusBar RC2
  50.  
  51.     /* Return */
  52.     EXIT 0
  53. END
  54. ELSE DO
  55.  
  56.     /* Print the reference */
  57.     'OpenDoc SETTINGS=BED:Support/SAS_C.prf DEFINITIONS=BED:Support/SAS_C.dfn'    filename
  58.  
  59.     ADDRESS VALUE RESULT
  60.     Move RC2
  61.     ScrollView 2
  62.  
  63.     /* Delete the temporary file */
  64.     ADDRESS COMMAND 'C:Delete >NIL:' filename
  65.  
  66.     /* Return */
  67.     EXIT 0
  68. END
  69.